package com.softeem.score.model.enmu;

public enum CourseNatureEnum {
    CompulsoryProfessional(1, "专业必修课"),
    ElectiveMajor(2, "专业选修课"),
    GeneralEducationCompulsory(3, "通识教育必修"),
    GeneralEducationElective(4, "通识教育选修"),
    ClassroomPracticeRequired(5, "课堂实践必修"),
    ClassPracticeElective(6, "课堂实践选修"),
    ConcentratedPracticeRequired(7, "集中实践必修"),
    ConcentratedPracticeElective(8, "集中实践选修"),
    InnovationEntrepreneurshipGeneralCompulsoryCourse(9, "创新创业通识必修课程"),
    InnovationEntrepreneurshipGeneralElectiveCourse(10, "创新创业通识选修课程");

    private final int id;
    private final String value;

    CourseNatureEnum(int id, String value) {
        this.id = id;
        this.value = value;
    }

    public int getId() {
        return id;
    }

    public String getValue() {
        return value;
    }

    // 根据ID获取对应的枚举值
    public static CourseNatureEnum getById(int id) {
        for (CourseNatureEnum nature : values()) {
            if (nature.id == id) {
                return nature;
            }
        }
        throw new IllegalArgumentException("无效的课程ID: " + id);
    }
}
